/*
 * @Description:
 * @Author: huiLong.lan
 * @Date: 2024-10-21 17:48:22
 * @LastEditors: huiLong.lan
 * @LastEditTime: 2024-10-21 17:48:22
 */
// 文章路由模块
const express = require('express')
const router = express.Router()

// 导入验证数据中间件
const expressJoi = require('@escook/express-joi')
// // 导入文章分类的验证模块
const {
  add_cate_schema,
  delete_cate_schema,
  get_cate_schema,
  update_cate_schema
} = require('../scheme/article')

// 导入文章处理函数
const artcate_handle = require('../router_handel/article')

router.get('/cates', artcate_handle.getArticleCates)

// 新增文章分类的路由
router.post('/addcates', expressJoi(add_cate_schema), artcate_handle.addArticleCates)

// / 删除文章分类的路由
router.get('/deletecate/:id', expressJoi(delete_cate_schema), artcate_handle.deleteCateById)

// 根据id 获取文章数据
router.get('/cates/:id', expressJoi(get_cate_schema), artcate_handle.getArticleById)

// 更新文章分类的路由
router.post('/updatecate', expressJoi(update_cate_schema), artcate_handle.updateCateById)

module.exports = router
